{# default Sliding pagination control implementation #}
{% set nextIcon = '<span class="e-pagination-button ' ~ 'app.icon.small.pagination.nextIcon' | trans ~ '"></span>' %}
{% set previousIcon = '<span class="e-pagination-button ' ~ 'app.icon.small.pagination.previousIcon' | trans ~ '"></span>' %}

{% set nextIcon = nextIcon|default('&gt;') %}
{% set previousIcon = previousIcon|default('&lt;') %}
<div class="row text-center">
    <div class="col-md-5 col-md-offset-3">
        {% if pageCount > 1 %}
        <ul class="pagination">
            {% if first is defined and current != first %}
                <li class="first">
                    <a href="{{ path(route, query|merge({(pageParameterName): first})) }}">{{ previousIcon | raw }}{{ previousIcon | raw }}</a>
                </li>
                {% if previous is defined %}
                    <li class="previous">
                        <a href="{{ path(route, query|merge({(pageParameterName): previous})) }}">{{ previousIcon | raw }}</a>
                    </li>
                {% else %}
                    <li class="disabled"><a href="#" onclick="return false;">{{ previousIcon | raw }}</a></li>
                {% endif %}
            {% else %}
                <li class="first disabled">
                    <a href="#" onclick="return false;">{{ previousIcon | raw }}{{ previousIcon | raw }}</a>
                </li>
                <li class="disabled"><a href="#" onclick="return false;">{{ previousIcon | raw }}</a></li>
            {% endif %}

            {% for page in pagesInRange %}
                {% if page != current %}
                    <li class="page">
                        <a href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
                    </li>
                {% else %}
                    <li class="current active"><a class="active" href="#" onclick="return false;">{{ page }}</a></li>
                {% endif %}

            {% endfor %}

            {% if last is defined and current != last %}
                {% if next is defined %}
                    <li class="next">
                        <a href="{{ path(route, query|merge({(pageParameterName): next})) }}">{{ nextIcon | raw }}</a>
                    </li>
                {% else %}
                    <li class="disabled"><a href="#" onclick="return false;">{{ nextIcon | raw }}</a></li>
                {% endif %}            
                <li class="last">
                    <a href="{{ path(route, query|merge({(pageParameterName): last})) }}">{{ nextIcon | raw }}{{ nextIcon | raw }}</a>
                </li>
            {% else %}        
                <li class="disabled"><a href="#" onclick="return false;">{{ nextIcon | raw }}</a></li>
                <li class="last disabled">
                    <a href="#" onclick="return false;">{{ nextIcon | raw }}{{ nextIcon | raw }}</a>
                </li>
            {% endif %}
        </ul>
        {% endif %}
    </div>
    <div class="col-md-4">
        <div class="pagination-number-text">
            {% if totalCount == 0 %}
                No {{ (recordName is defined ? recordName : 'app.word.records') | trans }} found
            {% else %}
                {{ numItemsPerPage*(current-1) + 1 }} - {{ min(numItemsPerPage*current, totalCount) }} of {{ totalCount }} {{ (recordName is defined ? recordName : 'app.word.records') | trans | lower }} shown
            {% endif %}
        </div>
    </div>
</div>
